package sites.manager.common.kit;

import javax.servlet.http.HttpSession;

/**
 * 用于在任意地方获取session中数据
 */
public class SessionKit {

    private static ThreadLocal<HttpSession> threadLocal = new ThreadLocal<HttpSession>();

    public static void setSession(HttpSession session){
        threadLocal.set(session);
    }

    public static HttpSession getSession(){
        return threadLocal.get();
    }

    public static void remove(){
        threadLocal.remove();
    }
}
